package com.kk.miaosha.controller;

import com.kk.miaosha.event.EventProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author : K k
 * @date : 16:53 2020/10/20
 */
@RestController
@RequestMapping("/mqTest")
public class MqTestController {

    @Autowired
    private EventProducer producer;
    /**
     * 发送消息到延迟队列
     * @param msg
     * @return
     */
    @GetMapping("send/{msg}")
    public String send(@PathVariable("msg")String msg){
        System.out.println("发送消息到延迟队列中: "+msg);
        return "success";
    }
}
